home *** CD-ROM | disk | FTP | other *** search
/ Scene 96 / Scene 96 International Edition (Zyklop Software) (Disc 2) (1997).iso / misc / coding / midas060 / src / mutils.inc < prev    next >
Encoding:
Text File  |  1997-01-16  |  5.0 KB  |  178 lines

  1. ;*      MUTILS.INC
  2. ;*
  3. ;* Miscellaneous utility functions for MIDAS Sound System used
  4. ;* by various system components.
  5. ;*
  6. ;* $Id: mutils.inc,v 1.3 1997/01/16 18:41:59 pekangas Exp $
  7. ;*
  8. ;* Copyright 1996,1997 Housemarque Inc.
  9. ;*
  10. ;* This file is part of the MIDAS Sound System, and may only be
  11. ;* used, modified and distributed under the terms of the MIDAS
  12. ;* Sound System license, LICENSE.TXT. By continuing to use,
  13. ;* modify or distribute this file you indicate that you have
  14. ;* read the license and understand and accept it fully.
  15. ;*
  16.  
  17.  
  18.  
  19. ;/***************************************************************************\
  20. ;*
  21. ;* Function:     int mGetKey(void)
  22. ;*
  23. ;* Description:  Waits for a keypress and returns the read key
  24. ;*
  25. ;* Returns:      ASCII code for the key pressed. Extended keycodes are
  26. ;*               returned with bit 8 set, eg. up arrow becomes \x148.
  27. ;*
  28. ;\***************************************************************************/
  29.  
  30. GLOBAL  LANG mGetKey : _funct
  31.  
  32.  
  33.  
  34.  
  35. ;/***************************************************************************\
  36. ;*
  37. ;* Function:     int mStrLength(char *str)
  38. ;*
  39. ;* Description:  Calculates the length of a ASCIIZ string
  40. ;*
  41. ;* Input:        char *str               pointer to string
  42. ;*
  43. ;* Returns:      String length excluding the terminating '\0'.
  44. ;*
  45. ;\***************************************************************************/
  46.  
  47. GLOBAL  LANG mStrLength : _funct
  48.  
  49.  
  50.  
  51.  
  52. ;/***************************************************************************\
  53. ;*
  54. ;* Function:     void mStrCopy(char *dest, char *src);
  55. ;*
  56. ;* Description:  Copies an ASCIIZ string from *src to *dest.
  57. ;*
  58. ;* Input:        char *dest              pointer to destination string
  59. ;*               char *src               pointer to source string
  60. ;*
  61. ;\***************************************************************************/
  62.  
  63. GLOBAL  LANG mStrCopy : _funct
  64.  
  65.  
  66.  
  67.  
  68. ;/***************************************************************************\
  69. ;*
  70. ;* Function:     void mStrAppend(char *dest, char *src);
  71. ;*
  72. ;* Description:  Appends an ASCIIZ string to the end of another.
  73. ;*
  74. ;* Input:        char *dest              pointer to destination string
  75. ;*               char *src               pointer to source string
  76. ;*
  77. ;\***************************************************************************/
  78.  
  79. GLOBAL  LANG mStrAppend : _funct
  80.  
  81.  
  82.  
  83. ;/***************************************************************************\
  84. ;*
  85. ;* Function:     void mMemCopy(char *dest, char *src, unsigned numBytes);
  86. ;*
  87. ;* Description:  Copies a memory block from *src to *dest.
  88. ;*
  89. ;* Input:        char *dest              pointer to destination
  90. ;*               char *src               pointer to source
  91. ;*               unsigned numBytes       number of bytes to copy
  92. ;*
  93. ;\***************************************************************************/
  94.  
  95. GLOBAL  LANG mMemCopy : _funct
  96.  
  97.  
  98.  
  99.  
  100. ;/***************************************************************************\
  101. ;*
  102. ;* Function:     int mMemEqual(char *m1, char *m2, unsigned numBytes);
  103. ;*
  104. ;* Description:  Compares two memory blocks.
  105. ;*
  106. ;* Input:        char *m1                pointer to memory block #1
  107. ;*               char *m2                pointer to memory block #2
  108. ;*               unsigned numBytes       number of bytes to compare
  109. ;*
  110. ;* Returns:      1 if the memory blocks are equal, 0 if not.
  111. ;*
  112. ;\***************************************************************************/
  113.  
  114. GLOBAL  LANG mMemEqual : _funct
  115.  
  116.  
  117.  
  118.  
  119. ;/***************************************************************************\
  120. ;*
  121. ;* Function:     long mHex2Long(char *hex)
  122. ;*
  123. ;* Description:  Converts a hexadecimal string to a long integer.
  124. ;*
  125. ;* Input:        char *hex               pointer to hex string, ASCIIZ
  126. ;*
  127. ;* Returns:      Value of the string or -1 if conversion failure.
  128. ;*
  129. ;\***************************************************************************/
  130.  
  131. GLOBAL  LANG mHex2Long : _funct
  132.  
  133.  
  134.  
  135.  
  136. ;/***************************************************************************\
  137. ;*
  138. ;* Function:     long mDec2Long(char *dec)
  139. ;*
  140. ;* Description:  Converts an unsigned decimal string to a long integer
  141. ;*
  142. ;* Input:        char *dec               pointer to string, ASCIIZ
  143. ;*
  144. ;* Returns:      Value of the string or -1 if conversion failure.
  145. ;*
  146. ;\***************************************************************************/
  147.  
  148. GLOBAL  LANG mDec2Long : _funct
  149.  
  150.  
  151.  
  152.  
  153. ;/**************************************************************************\
  154. ;*
  155. ;* Function:     char *mGetEnv(char *envVar);
  156. ;*
  157. ;* Description:  Searches a string from the environment
  158. ;*
  159. ;* Input:        envVar                  environment variable name, ASCIIZ
  160. ;*
  161. ;* Returns:      Pointer to environment string value (ASCIIZ), NULL if string
  162. ;*               was not found.
  163. ;*
  164. ;\**************************************************************************/
  165.  
  166. GLOBAL  LANG mGetEnv : _funct
  167.  
  168.  
  169. ;* $Log: mutils.inc,v $
  170. ;* Revision 1.3  1997/01/16 18:41:59  pekangas
  171. ;* Changed copyright messages to Housemarque
  172. ;*
  173. ;* Revision 1.2  1996/05/30 22:38:46  pekangas
  174. ;* no changes?
  175. ;*
  176. ;* Revision 1.1  1996/05/22 20:49:33  pekangas
  177. ;* Initial revision
  178. ;*